package com.ruoyi.project.mydy.actorprize.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.actorprize.mapper.DlActorPrizeMapper;
import com.ruoyi.project.mydy.actorprize.domain.DlActorPrize;
import com.ruoyi.project.mydy.actorprize.service.IDlActorPrizeService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 人物所获奖项Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlActorPrizeServiceImpl implements IDlActorPrizeService 
{
    @Autowired
    private DlActorPrizeMapper dlActorPrizeMapper;

    /**
     * 查询人物所获奖项
     * 
     * @param id 人物所获奖项主键
     * @return 人物所获奖项
     */
    @Override
    public DlActorPrize selectDlActorPrizeById(Long id)
    {
        return dlActorPrizeMapper.selectDlActorPrizeById(id);
    }

    /**
     * 查询人物所获奖项列表
     * 
     * @param dlActorPrize 人物所获奖项
     * @return 人物所获奖项
     */
    @Override
    public List<DlActorPrize> selectDlActorPrizeList(DlActorPrize dlActorPrize)
    {
        return dlActorPrizeMapper.selectDlActorPrizeList(dlActorPrize);
    }

    /**
     * 新增人物所获奖项
     * 
     * @param dlActorPrize 人物所获奖项
     * @return 结果
     */
    @Override
    public int insertDlActorPrize(DlActorPrize dlActorPrize)
    {
        dlActorPrize.setCreateTime(DateUtils.getNowDate());
        return dlActorPrizeMapper.insertDlActorPrize(dlActorPrize);
    }

    /**
     * 修改人物所获奖项
     * 
     * @param dlActorPrize 人物所获奖项
     * @return 结果
     */
    @Override
    public int updateDlActorPrize(DlActorPrize dlActorPrize)
    {
        return dlActorPrizeMapper.updateDlActorPrize(dlActorPrize);
    }

    /**
     * 批量删除人物所获奖项
     * 
     * @param ids 需要删除的人物所获奖项主键
     * @return 结果
     */
    @Override
    public int deleteDlActorPrizeByIds(String ids)
    {
        return dlActorPrizeMapper.deleteDlActorPrizeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除人物所获奖项信息
     * 
     * @param id 人物所获奖项主键
     * @return 结果
     */
    @Override
    public int deleteDlActorPrizeById(Long id)
    {
        return dlActorPrizeMapper.deleteDlActorPrizeById(id);
    }
}
